const TokenKey = 'ChatAi-Token'

export function getToken() {
  return window.localStorage.getItem(TokenKey)
}

export function setToken(token) {
  return window.localStorage.setItem(TokenKey, token)
}

export function removeToken() {
  return window.localStorage.clear()
}

/**
 * Set Local LocalStorage
 * @name {String} KEY
 * @data {all}
 */
export function setlocalStorage(name, data) {
  let storage = window.localStorage
  storage.setItem(name, data)
}

/**
 * Get Local LocalStorage
 * @name {String} KEY
 */
export function getlocalStorage(name) {
  let storage = window.localStorage
  let data = storage.getItem(name)
  return data
}
